import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { GameProvider } from './src/contexts/GameContext';
import GameScreen from './src/screens/GameScreen';
import FactionSelectScreen from './src/screens/FactionSelectScreen';

const Stack = createNativeStackNavigator();

const App = () => {
  return (
    <GameProvider>
      <NavigationContainer>
        <Stack.Navigator 
          initialRouteName="FactionSelect"
          screenOptions={{
            headerStyle: {
              backgroundColor: '#1a1a2e',
            },
            headerTintColor: '#fff',
            headerTitleStyle: {
              fontWeight: 'bold',
            },
          }}
        >
          <Stack.Screen 
            name="FactionSelect" 
            component={FactionSelectScreen} 
            options={{ title: '选择阵营' }}
          />
          <Stack.Screen 
            name="Game" 
            component={GameScreen} 
            options={{ 
              title: '永乐雄心',
              headerBackTitle: '返回'
            }}
          />
        </Stack.Navigator>
      </NavigationContainer>
    </GameProvider>
  );
};

export default App;
